package com.apop.demo.encrypt.impl;

import com.apop.demo.encrypt.EncryptionStrategy;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

/**
 * 通用RSA加密策略
 *
 * @Description:
 * @Author: zjy
 * @Date: 2025/2/26 15:20
 */
@Component("rsa")
@Slf4j
public class RSAEncryptionStrategy implements EncryptionStrategy {

    @Override
    public String encrypt(Object data) {
        String encryptedData = data.toString(); // 假设加密后的数据为原始数据
        log.debug("执行RSA加密逻辑...");
        return encryptedData;
    }

    @Override
    public String decrypt(Object encryptedData) {
        String decryptedData = encryptedData.toString(); // 假设解密后的数据为原始数据
        log.debug("执行RSA解密逻辑...");
        return decryptedData;
    }

    @Override
    public Boolean verifySignWithPublicKey(String original, String sign, String publicKey) {
        return Boolean.FALSE;
    }
}
